{extend name="base"/}
{block name="resources"}
<link rel="stylesheet" href="SHOP_CSS/goods_lists.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/searchable_select/searchable_select.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/extend/cascader/cascader.css"/>
<style>
    .marked-message {height:48px;background:#FFF5ED;font-size:14px;font-family:Source Han Sans SC;font-weight:400;color:#666;line-height:50px;padding:0 16px;display:flex;}
    .promote-flex {display:flex;margin-top:15px;padding:0 10px 0;}
    .promote-img {background-color:#f8f8f8;display:flex;justify-content:center;align-items:center;width:200px;height:200px;}
    .promote-img img {width:140px;height:140px;}
    .label-width {width:100px;}
    .block-left {margin-left:100px !important;display:flex;}
    .promote-download {margin-left:20px;}
    .h5-path {margin-left:20px;width:300px;}
    .h5-path .fuzhi {width:1px;height:0px;border:0px;}
    .h5-path span {display:block;margin-bottom:10px;}
    .h5-path p input {height:30px;line-height:30px;border:1px solid #e6e6e5;width:150px;padding:0px 5px;border-radius:5px;margin-right:10px;}
    .layui-table .table-btn {justify-content:flex-end;}
    .batch-operation-sku {display:block;}
    .batch-operation-sku .layui-form-label {width:unset}
    .batch-operation-sku span {margin-right:10px;display:inline-block;height:34px;line-height:34px;cursor:pointer;}
    .batch-operation-sku input {display:inline-block;}
    .batch-operation-sku input,.batch-operation-sku button {display:none;}
    .sku-table {display:none;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none}
    .sku-table .layui-input-block .img-wrap {display:inline-block;position:relative;margin:8px;border:1px solid #e5e5e5;}
    .sku-table .layui-input-block .img-wrap a {display:block;width:50px;height:50px;line-height:50px;text-align:center;overflow:hidden;}
    .sku-table .layui-input-block .img-wrap a img {width:100%;}
    .sku-table .layui-input-block .img-wrap .operation {position:absolute;top:0;z-index:10;width:50px;height:50px;background:rgba(0,0,0,0.3);color:#fff;cursor:pointer;line-height:50px;text-align:center;display:none;}
    .sku-table .layui-input-block .img-wrap:hover .operation {display:block;}
    .sku-table .layui-input-block .img-wrap .operation i {font-size:20px;}
    .sku-table .layui-input-block .upload-sku-img {border:1px dashed #d9d9d9;width:50px;height:50px;border-radius:2px;background-color:#fbfbfb;text-align:center;cursor:pointer;margin:8px;display:inline-block;padding:15px 0;box-sizing:border-box;}
    .sku-table .layui-input-block .layui-form-radio {margin:6px 0px 0 0;padding:0;}
    .sku-table .layui-input-block .layui-form-radio>i {margin-right:3px;}
    .batch-operation-sku .batch-btn {display:flex}
    .batch-operation-sku .batch-btn input {margin-right:10px}
    .category-wrap {width:185px!important;display: inline-block}
    .el-input__inner {height:34px;line-height:34px;border-radius:2px;}
</style>
{/block}
{block name="main"}
<!-- 按钮容器 -->
<div class="single-filter-box top">
    <button class="layui-btn" onclick="add()">添加商品</button>
</div>
<!-- 筛选面板 -->
<div class="screen layui-collapse" lay-filter="selection_panel">
    <div class="layui-colla-item">
        <form class="layui-colla-content layui-form layui-show">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">商品名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="search_text" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">商品编码：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sku_no" placeholder="请输入商品编码" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">商品分类：</label>
                    <div class="layui-input-inline category-wrap">
                        <input type="text" autocomplete="off" show="false" class="layui-input select-category" placeholder="请选择" readonly="">
                        <input type="hidden" name="category_id">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">商品品牌：</label>
                    <div class="layui-input-inline">
                        <select name="brand_id" lay-filter="brand_id">
                            <option value="">全部</option>
                            {foreach name="$brand_list" item="brand_vo"}
                            <option value="{$brand_vo['brand_id']}">{$brand_vo['brand_name']}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>

            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">商品类型：</label>
                    <div class="layui-input-inline">
                        <select name="goods_class" lay-filter="goods_class">
                            <option value="">全部</option>
                            <option value="1">实物商品</option>
                            <option value="2">虚拟商品</option>
                            {if $virtualcard_exit}
                            <option value="3">电子卡密</option>
                            {/if}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">商品标签：</label>
                    <div class="layui-input-inline">
                        <select name="label_id" lay-filter="label_id">
                            <option value="">全部</option>
                            {foreach name="$label_list" item="vo"}
                            <option value="{$vo['id']}">{$vo['label_name']}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">营销活动：</label>
                    <div class="layui-input-inline">
                        <select name="promotion_type" lay-filter="promotion_type">
                            <option value="">全部</option>
                            {foreach name="$promotion_type" item="vo"}
                            <option value="{$vo['type']}">{$vo['name']}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">商品销量：</label>
                    <div class="layui-input-inline">
                        <input type="number" name="start_sale" id="start_sale" lay-verify="int" placeholder="最低销量" class="layui-input" autocomplete="off">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline">
                        <input type="number" name="end_sale" id="end_sale" lay-verify="int" placeholder="最高销量" class="layui-input" autocomplete="off">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">商品价格：</label>
                    <div class="layui-input-inline input-append">
                        <input type="flaot" name="start_price" id="start_price" lay-verify="float" placeholder="最低价格" class="layui-input" autocomplete="off">
                    </div>
                    <div class="layui-form-mid">元</div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline input-append">
                        <input type="flaot" name="end_price" id="end_price" lay-verify="float" placeholder="最高价格" class="layui-input" autocomplete="off">
                    </div>
                    <div class="layui-form-mid">元</div>
                </div>
            </div>

            <input type="hidden" name="stockalarm" value="{$stockalarm}"/>
            <input type="hidden" name="goods_state" value="{$goods_state}"/>
            <div class="form-row">
                <button class="layui-btn" lay-submit lay-filter="search">筛选</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>
    </div>
</div>
<div class="layui-tab table-tab" lay-filter="goods_list_tab">
    <ul class="layui-tab-title">
        <li {if $goods_state=='' && $stockalarm==0}class="layui-this" {/if} lay-id="">全部</li>
        <li {if $goods_state=='1' }class="layui-this" {/if} lay-id="1" data-type="goods_state">销售中</li>
        <li {if $goods_state=='0' }class="layui-this" {/if} lay-id="0" data-type="goods_state">仓库中</li>
        <li {if $stockalarm=='1' } class="layui-this" {/if} lay-id="1" data-type="stockalarm">预警中</li>
    </ul>
    <div class="layui-tab-content">
        <!-- 列表 -->
        <table id="goods_list" lay-filter="goods_list"></table>
    </div>
</div>

<!-- 商品信息 -->
<script type="text/html" id="goods_info">
    <div class="table-title">
        <div class="contraction" data-goods-id="{{d.goods_id}}" data-open="0">
            <span>+</span>
        </div>
        <div class="title-pic" id="goods_img_{{d.goods_id}}" {if addon_is_exit('pc')} onclick="pc_url({{d.sku_id}})" {/if}>
            <!--layer-src="{{ns.img(d.goods_image.split(',')[0], 'big')}}" -->
            <img src="{{ns.img(d.goods_image.split(',')[0], 'small')}}"/>
        </div>
        {if addon_is_exit('pc')}
        <div class="title-content"  onclick="pc_url({{d.sku_id}})">
            <a href="javascript:;" class="multi-line-hiding text-color-sub" title="{{d.goods_name}}">{{d.goods_name}}</a>
        {else /}
        <div class="title-content">
            <a href="javascript:;" class="multi-line-hiding text-color-sub" title="{{d.goods_name}}" lay-event="preview">{{d.goods_name}}</a>
        {/if}
            {{# if(d.promotion_addon && d.promotion_addon_list){ }}
            <span class="promotion-addon">
					{{# for(var i=0;i<d.promotion_addon_list.length;i++){ }}
						<a href="{{ns.url( d.promotion_addon_list[i].url )}}">
                            <span class="bg-color" title="{{d.promotion_addon_list[i].name}}">{{ d.promotion_addon_list[i].short }}</span>
                        </a>
						{{# } }}
				</span>
            {{# } }}
            {{# if(d.label_name){ }}
            <span class="promotion-addon" >
                <span class="bg-color" style="background:red !important;">{{d.label_name}}</span>
            </span>
            {{# } }}
            {{# if(d.is_consume_discount ==1){ }}
            <span class="promotion-addon vips_price" data-goods-id="{{d.goods_id}}" data-open="0">
                <span class="layui-bg-black " title="会员价"><span class="iconfont icon"> VIP</span></span>
            </span>
            {{# } }}
            {{# if(d.sku_no){ }}
            <div>
                <span>{{d.sku_no}}</span>
            </div>
            {{# } }}
        </div>
        
    </div>
</script>

<!-- 操作 -->
<script type="text/html" id="operation">
    <div class="operation-wrap" data-goods-id="{{d.goods_id}}">
        <div class="popup-qrcode-wrap"><img class="popup-qrcode-loadimg" src="__STATIC__/loading/loading.gif"/></div>
        <div class="table-btn">
            <a class="layui-btn text-color" lay-event="edit">编辑</a>
            {{# if(d.goods_class == 2){ }}
            <a class="layui-btn" lay-event="verify">核销码</a>
            {{# } }}
            {{# if(d.goods_class == 3){ }}
            <a class="layui-btn" lay-event="carmichael">卡密管理</a>
            {{# } }}
            {{# if(d.goods_class == 1  || d.goods_class == 2){ }}
            <a class="layui-btn" lay-event="editStock">库存</a>
            {{# } }}
            {if $memberprice_is_exit == 1}
            <a class="layui-btn" lay-event="member_price">会员价</a>
            {/if}
            <a class="layui-btn" lay-event="more">更多</a>
            <div class="more-operation">
                <a class="operation" lay-event="spread">推广</a>
                {{# if(d.goods_state == 1){ }}
                <!-- <a class="layui-btn" lay-event="preview">预览</a> -->
                <a class="operation" lay-event="off_goods">下架</a>
                {{# }else{ }}
                <a class="operation" lay-event="on_goods">上架</a>
                {{# } }}
                <a class="operation" lay-event="browse_records">浏览记录</a>
                <a class="operation" lay-event="evaluate">评论</a>
                <a class="operation" lay-event="copy">复制</a>
                <a class="operation" lay-event="delete">删除</a>

            </div>
        </div>
    </div>
</script>

<!-- 批量操作 -->
<script type="text/html" id="toolbarOperation">
    <button class="layui-btn layui-btn-primary" lay-event="delete">批量删除</button>
    <!--<button class="layui-btn layui-btn-primary" lay-event="on_goods">批量上架</button>-->
    <!--<button class="layui-btn layui-btn-primary" lay-event="off_goods">批量下架</button>-->
    <button class="layui-btn layui-btn-primary" lay-event="batch_set">批量设置</button>
</script>

<!-- 批量操作 -->
<script type="text/html" id="batchOperation">
    <button class="layui-btn layui-btn-primary" lay-event="delete">批量删除</button>
    <!--<button class="layui-btn layui-btn-primary" lay-event="on_goods">批量上架</button>-->
    <!--<button class="layui-btn layui-btn-primary" lay-event="off_goods">批量下架</button>-->
    <button class="layui-btn layui-btn-primary" lay-event="batch_set">批量设置</button>
</script>

<!-- SKU商品列表 -->
<script type="text/html" id="skuList">
    <tr class="js-sku-list-{{d.index}}" id="sku_img_{{d.index}}">
        <td></td>
        {{# if (d.member_price_is_exit == 1) { }}
        <td colspan="9">
            {{# } else { }}
        <td colspan="8">
            {{# } }}
            <ul class="sku-list">
                {{# for(var i=0;i
                <d.list.length
                ;i++){ }}
                <li>
                    <div class="img-wrap">
                        <img layer-src="{{ns.img(d.list[i].sku_image, 'big')}}" src="{{ns.img(d.list[i].sku_image, 'small')}}">
                    </div>
                    <div class="info-wrap">
                        <span class="sku-name">{{d.list[i].sku_name}}</span>
                        <div>
                            {{# if(d.list[i].stock_alarm> 0 && d.list[i].stock<=d.list[i].stock_alarm){ }}
                            <span class="stock">库存：<label
                                    style="color:red;">{{d.list[i].stock}}（库存不足）</label></span>
                            {{# }else{ }}
                            <span class="stock">库存：{{d.list[i].stock}}</span>
                            {{# } }}
                            <span class="sale_num">销量：{{d.list[i].sale_num}}</span>
                        </div>
                    </div>
                    <div class="prices">
                        原价: ￥{{d.list[i].price}}
                        {{# if (d.list[i].member_price_list) { }}
                        {{# layui.each(d.list[i].member_price_list, function(index, item){ }}
                        <p class="vip_price">{{ item.level_name }}: ￥{{ item.member_price }}</p>
                        {{# }); }}
                        {{# } }}
                    </div>
                </li>

                {{# } }}
            </ul>
        </td>
    </tr>
</script>

<!-- 商品推广 -->
<script type="text/html" id="promote">
    <div class="">
        <div class="marked-message">
            <p>活动可分享至多个渠道推广，增加商品曝光率，提升商品分享打开率。
            </p>
        </div>
        <div class="promote-flex">
            <div class="promote-img">
                <img src="{{ ns.img(d.h5.path) }}" alt="推广二维码">
            </div>
            <div class="layui-form">
                <div class="layui-form-item">
                    <label class="layui-form-label label-width">选择渠道：</label>
                    <div class="layui-input-block block-left">
                        <input type="radio" name="promote_type" value="1" title="H5" checked lay-filter="promote_type" >
                        <input type="radio" name="promote_type" value="2" title="小程序" lay-filter="promote_type">
                    </div>
                </div>
                <div class="h5-path">
                    <span>推广链接</span>
                    <p class="tips text-color"><input type="text" value="{{d.h5.url}}" readonly /><a class="layui-btn" href="javascript:ns.copy('h5_url_{{ d.id }}');">复制</a></p>
                    <input type="text" id="h5_url_{{ d.id }}" value="{{d.h5.url}}" readonly class="fuzhi"/>
                </div>
                <div class="promote-download">
                    <a class="text-color" href="{{ ns.img(d.h5.path) }}" download>下载二维码</a>
                </div>
            </div>
        </div>

    </div>
</script>

<!-- 商品预览 -->
<script type="text/html" id="goods_preview">
    <div class="goods-preview">
        <div class="qrcode-wrap">
            <img src="{{ ns.img(d.path.h5.img) }}" alt="推广二维码">
            <p class="tips text-color">手机扫码购买</p>
        </div>
        <div class="phone-wrap">
            <div class="iframe-wrap">
                <iframe id="iframe" src="{{ d.path.h5.url }}&preview=1&time={:time()}" frameborder="0"></iframe>
                <div class="empty">
                    <img src="__STATIC__/img/wap_not_found.png"/>
                    <p>当前手机页面无法访问</p>
                    <a href="https://www.kancloud.cn/niucloud/niushop_b2c_v4/1842146" class="text-color" target="_blank">请检查手机端域名配置以及伪静态</a>
                </div>
            </div>
        </div>
    </div>
</script>

<script type="text/html" id="selectAddGoods">
    <div class="goods-type">
        <div class="item-type" onclick="location.href = ns.url('shop/goods/addGoods')">
            <div class="item-img"><img src="SHOP_IMG/goods_icon.png" alt=""></div>
            <div class="item-content">
                <p class="name">实物商品</p>
                <p class="description">（提供店铺线上服务商品的交易）</p>
            </div>
        </div>

        <div class="item-type" onclick="location.href = ns.url('shop/virtualgoods/addGoods')">
            <div class="item-img"><img src="SHOP_IMG/virtual_goods_icon.png" alt=""></div>
            <div class="item-content">
                <p class="name">虚拟商品</p>
                <p class="description">（虚拟商品支持核销管理）</p>
            </div>
        </div>
    </div>
</script>

<!-- 编辑排序 -->
<script type="text/html" id="editSort">
    <input name="sort" type="number" onchange="editSort({{d.goods_id}}, this)" value="{{d.sort}}"
           class="layui-input edit-sort len-short">
</script>

<!-- 编辑库存 -->
<script type="text/html" id="editStock">
    <input name="sort" type="number" onchange="editSort({{d.goods_id}}, this)" value="{{d.sort}}"
           class="layui-input edit-sort len-short">
</script>

{/block}

{block name="script"}
<!-- 编辑库存html -->
<script type="text/html" id="edit_stock">
    <div class="layui-form" id="edit_stock_block" lay-filter="form">
        <div class="layui-form-item batch-operation-sku">
            <label class="layui-form-label">批量操作：</label>
            <div class="layui-input-inline batch-btn">
                <span class="text-color" data-field="price" data-verify="price">销售价</span>
                <span class="text-color" data-field="market_price" data-verify="market_price">划线价</span>
                <span class="text-color" data-field="cost_price" data-verify="cost_price">成本价</span>
                <span class="text-color" data-field="stock" data-verify="stock">库存</span>
                {{# if(d.goods_class == 1){ }}
                <span class="text-color" data-field="weight" data-verify="weight">重量(kg)</span>
                <span class="text-color" data-field="volume" data-verify="volume">体积(m³)</span>
                {{# } }}

                {{# if(d.goods_class == 2 && d.virtual_deliver_type == 'verify'){ }}
                <span class="text-color" data-field="verify_num" data-verify="verify_num">核销次数</span>
                {{# } }}

                <span class="text-color" data-field="sku_no" data-verify="">商品编码</span>
                <input type="text" class="layui-input len-short batch-val" autocomplete="off" />
                <button class="layui-btn confirm" type="button">确定</button>
                <button class="layui-btn layui-btn-primary cancel" type="button">取消</button>
            </div>
        </div>

        <table class="layui-table" lay-skin="line">
            <colgroup>
                <col width="16%">
                <col width="12%">
                <col width="12%">
                <col width="12%">
                <col width="12%">
                {{# if(d.goods_class == 1){ }}
                <col width="12%">
                <col width="12%">
                {{# } }}
                {{# if(d.goods_class == 2 && d.virtual_deliver_type == 'verify'){ }}
                <col width="12%">
                {{# } }}
                <col width="12%">
            </colgroup>
            <thead>
            <tr>
                <th>商品名称</th>
                <th>销售价</th>
                <th>划线价</th>
                <th>成本价</th>
                <th>库存</th>
                {{# if(d.goods_class == 1){ }}
                <th>重量(kg)</th>
                <th>体积(m³)</th>
                {{# } }}
                {{# if(d.goods_class == 2 && d.virtual_deliver_type == 'verify'){ }}
                <th>核销次数</th>
                {{# } }}
                <th>商品编码</th>
            </tr>
            </thead>
            <tbody>
            {{# layui.each(d.sku_list, function(index, item){ }}
            <tr>
                <td><input type="hidden" name="sku_list[{{index}}][sku_id]" value="{{ item.sku_id }}"
                           class="layui-input">{{ item.sku_name }}
                </td>
                <td><input type="number" name="sku_list[{{index}}][price]" value="{{ item.price }}"
                           class="layui-input price" lay-verify="price"></td>
                <td><input type="number" name="sku_list[{{index}}][market_price]" value="{{ item.market_price }}"
                           class="layui-input market_price" lay-verify="market_price"></td>
                <td><input type="number" name="sku_list[{{index}}][cost_price]" value="{{ item.cost_price }}"
                           class="layui-input cost_price" lay-verify="cost_price"></td>
                <td><input type="number" name="sku_list[{{index}}][stock]" value="{{ item.stock }}"
                           class="layui-input stock" lay-verify="goods_stock"></td>
                {{# if(d.goods_class == 1){ }}
                <td><input type="number" name="sku_list[{{index}}][weight]" value="{{ item.weight }}"
                           class="layui-input weight" lay-verify="weight"></td>
                <td><input type="number" name="sku_list[{{index}}][volume]" value="{{ item.volume }}"
                           class="layui-input volume" lay-verify="volume"></td>
                {{# } }}

                {{# if(d.goods_class == 2 && d.virtual_deliver_type == 'verify'){ }}
                <td><input type="number" name="sku_list[{{index}}][verify_num]" value="{{ item.verify_num }}"
                           class="layui-input verify_num" lay-verify="verify_num"></td>
                {{# } }}
                <td><input type="text" name="sku_list[{{index}}][sku_no]" value="{{ item.sku_no }}"
                           class="layui-input sku_no"></td>
            </tr>
            {{# }); }}
            </tbody>
        </table>

        <div class="form-row">
            <button class="layui-btn" lay-submit lay-filter="edit_stock">确定</button>
            <button class="layui-btn layui-btn-primary" onclick="closeStock()">返回</button>
        </div>
    </div>
</script>

<!-- 批量操作 -->
<script type="text/html" id="batchSet">
    <div class="batch-set-wrap">
        <div class="tips">每次仅能设置一项，点击保存成功之后生效</div>
        <div class="set-wrap">
            <div class="tab-wrap">
                <ul>
                    <li class="active" data-type="group">商品标签</li>
                    <li data-type="service">商品服务</li>
                    <li data-type="sale">虚拟销量</li>
                    <li data-type="purchase_limit">商品限购</li>
                    <li data-type="shipping">包邮设置</li>
                    <li data-type="category">商品分类</li>
                    {if $memberprice_is_exit == 1}
                    <li data-type="member_price">会员价</li>
                    {/if}
                    <li data-type="stock">库存设置</li>
                    <li data-type="price">修改价格</li>
                </ul>
            </div>
            <div class="content-wrap">

                <div class="tab-item tab-show group">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品标签：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <select name="batch_goods_label" lay-search="">
                                        <option value="0">请选择商品标签</option>
                                        {foreach name="$label_list" item="vo"}
                                        <option value="{$vo['id']}">{$vo['label_name']}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-item service">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品服务：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    {foreach name="$service_list" item="vo"}
                                    <input type="checkbox" name="batch_goods_service" value="{$vo.id}"
                                           title="{$vo.service_name}" lay-skin="primary">
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-item sale">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">已售出数：</label>
                            <div class="layui-input-block">
                                <input type="number" name="batch_virtual_sale" placeholder="0" value="0"
                                       lay-verify="virtual_sale" class="layui-input len-short" autocomplete="off">
                                <div class="layui-form-mid">/件</div>
                            </div>
                            <div class="word-aux">该设置不计入商品统计数据</div>
                        </div>
                    </div>
                </div>

                <div class="tab-item purchase_limit">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品限购：</label>
                            <div class="layui-input-block">
                                <input type="number" name="batch_max_buy" value="0" lay-verify="max_buy"
                                       class="layui-input len-short" autocomplete="off">
                                <div class="layui-form-mid">/件</div>
                            </div>
                            <div class="word-aux">该限购为终身限购，0为不限购</div>
                        </div>
                    </div>
                </div>

                <div class="tab-item shipping">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否包邮：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="is_free_shipping" value="1" title="是" checked>
                                    <input type="radio" name="is_free_shipping" value="0" title="否">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item hide shipping_template">
                            <label class="layui-form-label">运费模板：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <select name="batch_shipping_template" lay-search="">
                                        <option value="0">请选择运费模板</option>
                                        {foreach name="$express_template_list" item="vo"}
                                        <option value="{$vo['template_id']}">{$vo['template_name']}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="word-aux">该设置仅对实物商品有效</div>
                    </div>
                </div>

                <div class="tab-item category">
                    <div class="layui-form-item">
                        <label class="layui-form-label goods-category-css"><span class="required">*</span>商品分类：</label>
                        <div class="layui-input-block goods-cate">
                            <div class="layui-block first">
                                <div class="category-wrap">
                                    <input type="text" readonly lay-verify="required" autocomplete="off" class="layui-input select-category"/>
                                    <input type="hidden" class="category_id"/>
                                </div>
                                <a href="javascript:;" class="text-color js-add-category">添加分类</a>
                            </div>
                        </div>
                        <div class="word-aux">商品可以属于多个分类，最多10个</div>
                    </div>
                </div>
                <div class="tab-item shop_intor">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">推荐方式：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="recom_way" value="0" title="无" checked>
                                    <input type="radio" name="recom_way" value="1" title="新品">
                                    <input type="radio" name="recom_way" value="2" title="精品">
                                    <input type="radio" name="recom_way" value="3" title="推荐">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-item member_price">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否参与：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="is_consume_discount" value="0" title="不参与" checked>
                                    <input type="radio" name="is_consume_discount" value="1" title="参与">
                                </div>
                            </div>
                        </div>
                        <div class="word-aux">批量设置参与会员等级折扣的商品，如果之前未单独配置过优惠规则，则按照默认会员等级折扣优惠</div>
                    </div>
                </div>
                <div class="tab-item stock">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">修改库存：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="stock_type" value="inc" title="添加库存" checked>
                                    <input type="radio" name="stock_type" value="dec" title="减少库存">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">目标数值：</label>
                            <div class="layui-input-block">
                                <input type="number" name="stock_num" placeholder="0" value="0" class="layui-input len-short" autocomplete="off" onblur="stockinput(this)">
                            </div>
                        </div>
                        <div class="word-aux">批量调整商品库存，该操作不会改变电子卡密的库存</div>
                    </div>
                </div>
                <div class="tab-item price">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">计算方式：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="type" lay-filter="type"value="money" title="固定金额" checked>
                                    <input type="radio" name="type" lay-filter="type"value="calculate" title="公式计算">
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline"style="width:84px;">
                                    <select name="price_type" lay-verify="required">
                                        <option value="sale">销售价</option>
                                        <option value="cost">划线价</option>
                                        <option value="market">成本价</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    =
                                </div>

                                <div class="layui-input-inline price-calculate-block" style="display:none;">
                                    <div class="layui-input-inline"style="width:84px;">
                                        <select name="calculate_price_type" lay-verify="required">
                                            <option value="sale">销售价</option>
                                            <option value="cost">划线价</option>
                                            <option value="market">成本价</option>
                                        </select>
                                    </div>
                                    <div class="layui-input-inline"style="width:50px;">
                                        <select name="sign" lay-filter="sign" lay-verify="required">
                                            <option value="add">+</option>
                                            <option value="subtract">-</option>
                                            <option value="multiply">x</option>
                                            <option value="division">÷</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-input-inline len-short">
                                    <input type="number" name="price" autocomplete="off" class="layui-input"/>
                                </div>
                                <div class="layui-input-inline price-unit money-price-unit">
                                    元
                                </div>
                                <div class="layui-input-inline price-unit calculate-price-unit" style="display:none;">
                                    元
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form precise-block" style="display:none;">
                        <div class="layui-form-item">
                            <label class="layui-form-label">计算精度：</label>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <input type="radio" name="precise" lay-filter="precise"value="1" title="全部保留" checked>
                                    <input type="radio" name="precise" lay-filter="precise"value="2" title="抹分" >
                                    <input type="radio" name="precise" lay-filter="precise"value="3" title="抹角" >
                                    <input type="radio" name="precise" lay-filter="precise"value="4" title="四舍五入到分" >
                                    <input type="radio" name="precise" lay-filter="precise"value="5" title="四舍五入到角" >
                                    <input type="radio" name="precise" lay-filter="precise"value="6" title="四舍五入到元" >
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="tab-item result">
                    <img src="SHOP_IMG/success.png">
                    <div class="text">设置成功</div>
                </div>
            </div>
        </div>
        <div class="footer-wrap">
            <button class="layui-btn layui-btn-primary" onclick="layer.closeAll()">取消</button>
            <button class="layui-btn" onclick="batchSetting()">保存</button>
        </div>
    </div>
</script>

<!--选择商品分类-->
<script type="text/html" id="selectedCategory">
    <div class="category-list">

        <div class="item">
            <!--后续做搜索-->
            <ul>
                {foreach name="$goods_category_list" item="vo"}
                    {{# if(d.category_id_1 == '{$vo['category_id']}' ){ }}
                    <li data-category-id="{$vo['category_id']}" data-commission-rate="{$vo['commission_rate']}" data-level="{$vo['level']}" class="selected">
                    {{# }else{ }}
                    <li data-category-id="{$vo['category_id']}" data-commission-rate="{$vo['commission_rate']}" data-level="{$vo['level']}">
                    {{# } }}
                    <span class="category-name">{$vo['category_name']}</span>
                    <span class="right-arrow">&gt;</span>
                </li>
                {/foreach}
            </ul>
        </div>

        <div class="item" data-level="2">
            <!--后续做搜索-->
            <ul></ul>
        </div>

        <div class="item" data-level="3">
            <!--后续做搜索-->
            <ul></ul>
        </div>

    </div>

    <div class="selected-category-wrap">
        <label>您当前选择的是：</label>
        <span class="js-selected-category"></span>
    </div>
</script>

<script>
    var member_price_is_exit = "{$memberprice_is_exit}";
    var goods_sort = '{$goods_sort}';
    var pc_domain = '{$pc_domain}';
    layui.extend({
        layCascader: '__STATIC__/ext/layui/extend/cascader/cascader'
    })
</script>
<script src="SHOP_JS/goods_list.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/ext/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/ext/ueditor/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/ext/ueditor/lang/zh-cn/zh-cn.js"></script>
{/block}
